<?php

class EstoqueController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // action body
        $model  = new Application_Model_Estoque();
        $rowSet = $model->fetchAll();
        
        $this->view->rowSet = $rowSet;
    }
    
    public function createAction()
    {
    }
    
    public function updateAction()
    {
        $model  = new Application_Model_Estoque();
        $row = $model->fetchRow("id_estoque = {$this->_getParam('id')}");
    	$this->view->row = $row;
    }
    
    public function inserirAction()
    {
    	$model = new Application_Model_Estoque();
    	$id = $model->inserir( $this->_getAllParams() );

    	$this->_redirect('estoque/index');
    }
    
    public function atualizarAction()
    {
    	$model = new Application_Model_Estoque();
    	$id = $model->atualizar( $this->_getAllParams() );

    	$this->_redirect('estoque/index');
    }
    
    public function excluirAction()
    {
    	$model = new Application_Model_Estoque();
    	$id = $model->atualizar( $this-> );

    	$this->_redirect('estoque/index');
    }
    
}

